import React, {Component} from "react";

import Hello from "./components/Hello";
import Tab from "./components/Tab"

export default class LayOut extends Component{
    control = () => {
        // this.refs.hello.changFlag()
        this.helloCom.changFlag()
    }
   
    render() {
        return(
            <div>
              <Tab control={this.control} />
              {/* <Hello ref="hello" />  这样会报错的 */}
              <Hello ref={el => this.helloCom = el} />
            </div>
        )
    }
}

// export default function LayOut() {
   
//     return(
//         <div>
//           <Hello />
//           <Tab />
//         </div>
//     )
// }